package token

const (
	Unknown = iota
	EOF
	Keyword
	Let
	Return
	Function
	Identifier
	Digits
	Equal
	Plus
	PlusEqual
	Minus
	MinusEqual
	Product
	ProductEqual
	Divide
	DivideEqual
	Bang
	Lparen       // (
	Rparen       // )
	Lbracket     // [
	Rbracket     // ]
	Lbrace       // {
	Rbrace       // }
	SemiColon    // ；
	Colon        // ：
	Comma        // , ，
	DoubleQuotes // , ，
	SingleQuotes // , ，
	Struct
	Class
	Break
	Continue
	If
	Else
	Elif
)

var Keywords = map[string]int{
	"let":      Let,
	"return":   Return,
	"function": Function,
	"struct":   Struct,
	"class":    Class,
	"break":    Break,
	"continue": Continue,
	"if":       If,
	"else":     Else,
	"elif":     Elif,
}

type Token struct {
	Type    int
	Literal string
}

func NewToken(typ int, lit string) *Token {
	return &Token{
		Type:    typ,
		Literal: lit,
	}
}
